package com.bac.rentmap.ad.util;

import java.util.Calendar;
import java.util.Date;

public class DateHelper {
    public Date getDateForMidnight(int addDays) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, addDays);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        return calendar.getTime();
    }

    public Date getDateForMidnight() {
        return getDateForMidnight(0);
    }
}
